using UnityEngine;
using System.Collections;

public class enemy : MonoBehaviour {
public Transform targetLoc;
float speed = 40f;
float increaseTime = 5;
bool isUp = true;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		transform.position = Vector3.MoveTowards(transform.position, targetLoc.position, speed*Time.deltaTime);
		if(isUp == true)
		{
			isUp = false;
			speed = speed+2;
			Invoke("setTrue", increaseTime);
		}
	}
	
	void OnCollisionStart(Collision collision)
	{
		
	}
	
	void setTrue()
	{
		isUp = true;
	}
	
}
